package com.syh.jn.scm.service.api.supplier.finance.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface BusinessAccountRecordEnums {

  /**
   * 库存记录来源单据类型
   */
  @AllArgsConstructor
  @Getter
  public enum Type {
    //1销售单类型,2采购退货单,3收入单,4付款单,5采购单,6销售退货单,7费用单,8收款单,9物流单
    SALE_ORDER(Short.valueOf("1"), "销售单类型", "来源单据类型"),
    PURCHASE_RETURN_ORDER(Short.valueOf("2"), "采购退货单", "来源单据类型"),
    INCOME_BILL(Short.valueOf("3"), "收入单", "来源单据类型"),
    PAYMENT_BILL(Short.valueOf("4"), "付款单", "来源单据类型"),
    PURCHASE_ORDER(Short.valueOf("5"), "采购单", "来源单据类型"),
    SALE_RETURN_ORDER(Short.valueOf("6"), "销售退货单", "来源单据类型"),
    COST_BILL(Short.valueOf("7"), "费用单", "来源单据类型"),
    RECEIPT_BILL(Short.valueOf("8"), "收款单", "来源单据类型"),
    SALE_LOGISTICS_BILL(Short.valueOf("9"), "销售物流单", "来源单据类型"),
    PURCHASE_RETURN_LOGISTICS_BILL(Short.valueOf("10"), "采购退货物流单", "来源单据类型"),
    SALE_DISCOUNT(Short.valueOf("11"), "销售订单优惠减免", "来源单据类型"),
    SALE_RETURN_DISCOUNT(Short.valueOf("12"), "销售退货订单优惠减免", "来源单据类型"),
    PUR_DISCOUNT(Short.valueOf("13"), "采购订单优惠减免", "来源单据类型"),
    PUR_RETURN_DISCOUNT(Short.valueOf("14"), "采购退货订单优惠减免", "来源单据类型"),
    SALE_OTHER_EXPENSES(Short.valueOf("15"), "销售订单其他费用", "来源单据类型"),
    PURCHASE_OTHER_EXPENSES(Short.valueOf("16"), "采购订单其他费用", "来源单据类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static Type valueOf(Short status) {
      switch (status) {
        case 1:
          return SALE_ORDER;
        case 2:
          return PURCHASE_RETURN_ORDER;
        case 3:
          return INCOME_BILL;
        case 4:
          return PAYMENT_BILL;
        case 5:
          return PURCHASE_ORDER;
        case 6:
          return SALE_RETURN_ORDER;
        case 7:
          return COST_BILL;
        case 8:
          return RECEIPT_BILL;
      }
      return null;
    }
  }

  @AllArgsConstructor
  @Getter
  public enum DataType {
    //操作类型(1：常规操作 2：回滚操作)
    NORMAL(Short.valueOf("1"), "常规操作", "操作类型"),
    ROLL_BACK(Short.valueOf("2"), "回滚操作", "操作类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static DataType valueOf(Short status) {
      switch (status) {
        case 1:
          return NORMAL;
        case 2:
          return ROLL_BACK;
      }
      return null;
    }
  }
}
